package com.wnhz.work.jy.fragment;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.wnhz.work.jy.R;
import com.wnhz.work.jy.activity.GoodDetailsMainActivity;

/**
 * A simple {@link Fragment} subclass.
 * -----产品参数
 */
public class ProductParameterFragment extends Fragment {
    private View view;

    private TextView material_tv;
    private TextView tv_weight;
    private TextView forme;
    private TextView theme;
    private TextView faceValue;
    private TextView year;
    private TextView delicateDegree;
    private TextView series;
    private GoodDetailsMainActivity activity;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment_product_parameter, container, false);
        activity = (GoodDetailsMainActivity) getActivity();
        initView();
        return view;
    }

    private void initView() {
        material_tv = (TextView) view.findViewById(R.id.material_tv);
        tv_weight = (TextView) view.findViewById(R.id.tv_weight);
        forme = (TextView) view.findViewById(R.id.forme);
        delicateDegree = (TextView) view.findViewById(R.id.delicateDegree);
        theme = (TextView) view.findViewById(R.id.theme);
        faceValue = (TextView) view.findViewById(R.id.faceValue);
        year = (TextView) view.findViewById(R.id.year);
        series = (TextView) view.findViewById(R.id.series);
    }

    public void setData(){
        material_tv.setText(activity.goodDetailsBean.getMaterial());
        tv_weight.setText(activity.goodDetailsBean.getWeight());
        forme.setText(activity.goodDetailsBean.getForme());
        delicateDegree.setText(activity.goodDetailsBean.getDelicateDegree());
        theme.setText(activity.goodDetailsBean.getTheme());
        faceValue.setText(activity.goodDetailsBean.getFaceValue());
        year.setText(activity.goodDetailsBean.getYear());
        series.setText(activity.goodDetailsBean.getSeries());
    }

}
